
Use Tunga;

GO
--Insert
Alter PROC insertCustormer
	@[username] nvarchar(100),
	@[password] nvarchar(100),
	@[fullname] nvarchar(100),
	@[dob] datetime,
	@[gender] bit,
	@[address] nvarchar(100),
	@[phone] nvarchar(100),
	@[email] nvarchar(100),
AS
INSERT INTO  Custormer([username],[password],[fullname],[dob],[gender],[address],[phone],[email])
 VALUES(@[username],@[password],@[fullname],@[dob],@[gender],@[address],@[phone],@[email])


GO
--update
Alter PROC updateCustormer
	@[id] int,
	@[username] nvarchar(100),
	@[password] nvarchar(100),
	@[fullname] nvarchar(100),
	@[dob] datetime,
	@[gender] bit,
	@[address] nvarchar(100),
	@[phone] nvarchar(100),
	@[email] nvarchar(100),
AS
UPDATE Custormer SET
	[username]=@[username],
	[password]@[password],
	[fullname]=@[fullname],
	[dob]=@[dob],
	[gender]=@[gender],
	[address]=@[address],
	[phone]=@[phone],
	[email]=@[email],
WHERE [id]=@[id]
GO
--Delete

CREATE PROC deleteCustormer
	@[id] int
AS
	DELETE FROM Custormer WHERE id=@[id]
GO
--Get All
CREATE PROC getAllCustomer
AS
	SELECT * from Custormer 
GO
--Login
CREATE PROC CustormerLogin
	@[username] nvarchar(100),
	@[password] nvarchar(100)
AS
SELECT * from Custormer where [username]=@[username] and [password]=@[password]
GO
--Get Customer By ID
CREATE PROC getCustomerByID
	@[id] int
AS
	SELECT * from Custormer WHERE [id]=@[id]
Go
--Check Exist Customer
CREATE PROC checkExistCustomer
	@[username] nvarchar(100)
AS
SELECT * from Custormer where [username]=@[username]
GO
